<html>
<head><meta charset="utf-8"><title>Regions in file structure · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Regions.20in.20file.20structure.html">Regions in file structure</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="229858376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Regions%20in%20file%20structure/near/229858376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ivan770 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Regions.20in.20file.20structure.html#229858376">(Mar 11 2021 at 14:38)</a>:</h4>
<p>Hi! While trying to implement <a href="https://github.com/rust-analyzer/rust-analyzer/issues/7913">https://github.com/rust-analyzer/rust-analyzer/issues/7913</a> I stumbled upon difficulties describing regions in LSP (needed for <code>SymbolKind::RegionStart</code> and <code>SymbolKind::RegionEnd</code>). Is there a semantic token for region describing?</p>



<a name="229862631"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Regions%20in%20file%20structure/near/229862631" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Regions.20in.20file.20structure.html#229862631">(Mar 11 2021 at 15:02)</a>:</h4>
<p>there isn't appropriate lsp symbol kind for this, I'd just re-used module</p>



<a name="229872808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Regions%20in%20file%20structure/near/229872808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ivan770 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Regions.20in.20file.20structure.html#229872808">(Mar 11 2021 at 15:59)</a>:</h4>
<p><a href="/user_uploads/4715/T2UQk1nYafCLu8HbFg_UHoYF/printer.mp4">printer.mp4</a> Hope that suits the issue</p>



<a name="229876836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Regions%20in%20file%20structure/near/229876836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Daniel Mcnab <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Regions.20in.20file.20structure.html#229876836">(Mar 11 2021 at 16:14)</a>:</h4>
<p>One thought about this is if we introduce this as a first class feature, we're sort of extending the language by force<br>
That is, if most peoples are using rust-analyzer, then the region marker becomes the de-facto standard to mark regions.<br>
I don't think in this case it matters too much, since I don't think there's any other likely syntax.</p>



<a name="229877214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Regions%20in%20file%20structure/near/229877214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Regions.20in.20file.20structure.html#229877214">(Mar 11 2021 at 16:15)</a>:</h4>
<p>agree here! but practicality beats purity -- vscode's in-editor region folding doesnt work if we provide any folds, so we have to provide our own impl. The LSP also has first-class support for region folds</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>